<?php

/**
 * 前台 前页面 模块 Controller
 * ============================================================================
 * TBlog TBlog博客系统　BY Tmac PHP MVC framework
 * $Author: zwt007 $  <zwttmac@qq.com>
 * $Id: page.php 40 2011-07-11 17:15:06Z zwt007 $
 * http://www.t-mac.org；
 */
class zlzsAction extends Action
{

    private $tmp_model;
    private $show_model;
    private $index_model;

    public function _init()
    {
        $this->assign('action', $_GET['TMAC_ACTION']);
        $this->tmp_model = Tmac::model('news');
        $this->show_model = Tmac::model('show');
        $this->index_model = Tmac::model('index');
        $this->difang_model = Tmac::model('difang');        

        $username = $this->H($this->getParam('username'));
        $this->userinfo = $this->difang_model->getUserinfo($username);

        $this->config = $this->index_model->getCommon($this->userinfo);
        
        $nav_array = $this->difang_model->getCategoryArray($this->userinfo['uid'], 0);

        $hotel_list_nopage_array = $this->show_model->getHotelListNoPage($this->userinfo['uid'],5);
        //left hotel nopage
        $news_list_nopage_array = $this->show_model->getArticleNewsListNopage(8, $this->userinfo['uid']);
        //left 会议常识
        $hycs_cid = 70;
        $hycs_list_nopage_array = $this->show_model->getArticleNewsListNopageB($hycs_cid, $this->userinfo['uid']);

        $this->assign('hotel_list_nopage_array', $hotel_list_nopage_array);
        $this->assign('news_list_nopage_array', $news_list_nopage_array);
        $this->assign('hycs_list_nopage_array', $hycs_list_nopage_array);
        $this->assign('hycs_cid', $hycs_cid);
        $this->assign('nav_array', $nav_array);
        $this->assign('userinfo', $this->userinfo);
    }

    public function index()
    {
        $cat_id = intval($this->getParam('cid'));
        $cid = empty($cat_id) ? 6 : $cat_id;
        $catinfo = $this->show_model->getCategoryInfoById($cid, $this->userinfo['uid']);
        
        //下级栏目        
        $url = 'zlzs';
        $this->index_model->getCategoryList(10, $url, $this->userinfo['uid'], $this->userinfo['username'], $this->config['cfg_indexurl']);

        $now_url = '<a href="' . $this->config['cfg_indexurl'] . '">燕泰机构</a> > <a href="' . PHP_SELF . '?m=difang&username=' . $this->userinfo['username'] . '">燕泰' . $this->userinfo['nicename'] . '</a>';
        $now_url .= ' > <a href="' . PHP_SELF . '?m='.$url.'&username=' . $this->userinfo['username'] . '">展览展示</a>';
        if (!empty($cid) && $cid <> 10) {
            $now_url.=' > ' . $catinfo['cat_name'];
        }
        
        $this->assign('now_url', $now_url);        
        $this->assign('catinfo', $catinfo);
        $this->assign('cid', $cat_id);

        $this->V('page');
    }

}